Skip to content

add native library loading and update readme - #88

Merged
inmny merged 15 commits into
WorldBoxOpenMods:masterfrom
MelvinShwuaner:master
Nov 20, 2026
Merged

inmny merged 15 commits into
WorldBoxOpenMods:masterfrom
MelvinShwuaner:master

Conversation

@MelvinShwuaner

Copy link
Copy Markdown
Contributor

why? idk. seems fun. also allows modders to create their own mods in native code like holy C or rust

@MelvinShwuaner

MelvinShwuaner commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor Author

Tested on android.. it works! i got holy c running!

@MelvinShwuaner

Copy link
Copy Markdown
Contributor Author

alr nvm mods can load native libraries as "mods" themselves. anyway this should be complete now

@inmny inmny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by Codex (GPT-6.2-Sol).

I’d hold off on merging until native library loading works both at startup and when enabling mods in-game, and existing Android asset bundles remain compatible.

  1. [P1] Keep the startup queue running when one mod’s native library fails to load (WorldBoxMod.cs:148)
    LoadNativeLibrariesFromFolder can throw if a library has the wrong architecture, a dependency is missing, or order.json is invalid. The exception escapes the startup callback, and SmoothLoader advances its queue only after the callback returns successfully. That means one broken mod can prevent later mods and NeoModLoader itself from finishing initialization. Please record the error against the affected mod, skip loading it, and let unrelated startup tasks continue.

  2. [P1] Load native libraries when enabling a mod in-game (WorldBoxMod.cs:148)
    The new loader is called only at startup. When a player enables a mod from Manage Mods, TryLoadCompiledModAtRuntime loads its resources and asset bundles, then calls LoadMod without loading its native libraries. A mod that calls GetNativeFunction from OnLoad can therefore fail to enable in-game even though it loads at startup. Please share the native library loading step between both paths and run it before OnLoad.

  3. [P2] Preserve support for existing Android asset bundle folders (utils/ResourcesPatch.cs:138)
    Changing the Android folder from AssetBundles/and to AssetBundles/android causes existing mods packaged under and to lose their asset bundles. Please keep and as the existing convention, or fall back to it when android is absent.

The Windows CI check and a local build passed. The findings above are based on tracing the affected code paths; I haven’t verified them in-game.

@MelvinShwuaner

Copy link
Copy Markdown
Contributor Author

-the "and" folder hasn't been used by anyone to my knowledge (yet)
i should also display a warning for native libraries because they can be dangerous

@inmny
inmny merged commit a2320c9 into WorldBoxOpenMods:master Nov 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants